﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DevExpress.XtraReports.UI;
using Devices;
using Devices.Print;

namespace Devices.Print
{
    public class Y_UniversalPrint : IPrint
    {
        private Devices.PrintInfo pinfo;

        public PrintInfo PrintInfo
        {
            get
            {
                if (pinfo == null)
                {
                    pinfo = new PrintInfo(true);
                    pinfo.Dll = "Print_yhl.dll";
                    pinfo.ClassName = "DevicesView.Print.Y_UniversalPrint";
                    pinfo.Name = "基础打印1";
                    PrintInfo.Author = "yhl";
                }
                return pinfo;
            }
            set
            {
                pinfo = value;
            }
        }
        public void Preview(List<Result> result)
        {
            LabReportA4 labReportA4 = new LabReportA4(result);
            labReportA4.ShowPreviewDialog();
        }
        public void Preview(List<Result> result, string PrinterName)
        {
            LabReportA4 labReportA4 = new LabReportA4(result);
            labReportA4.ShowPreviewDialog();
        }
        public void Print(List<Result> result)
        {
            LabReportA4 labReportA4 = new LabReportA4(result);
            labReportA4.Print();
        }

        public void Print(List<Result> result, string PrinterName)
        {
            LabReportA4 labReportA4 = new LabReportA4(result);
            labReportA4.Print(PrinterName);
        }
    }
}
